//定义组件
define(function (require, exports, module) {
    var a = 1;
    var sTpl = require('./index.html');
    var css = require('./index.css');

    var myMixin = require('mixins/mixins.js');

    var vueComponent = Vue.extend({
        template: sTpl,
        mixins: [myMixin],
        props: {
            "show": {
                default: true,
                type: Boolean,
                desc: '是否显示'
            },
            "title": {
                default: '',
                type: String, // 类型
                required: false, //是否必填
                desc: '标题'
            },
            'headShow': {
                default: true,
                desc: '头部显示'
            },
            'collapse': {
                default: false,
                desc: '主体折叠'
            },
            'noPadding': {
                default: false,
                desc: '主体无padding'
            }
        },
        data: function () {
            return {


            }
        },
        methods: {
            toggleShow: function (to) {
                if (to) {
                    this.collapse = to;
                } else {
                    this.collapse = !this.collapse;
                }

                this.$emit("toggleShow", this.collapse);
            },
            headerOnClick: function () {
                this.toggleShow();
            }
        }
    });

    Vue.component('m-card', vueComponent); //都全局注册 

    //如果用cmd加载组件  
    if (typeof define === "function" && define.cmd) {
        module.exports = vueComponent;
    }

});